package com.hngy.java.stream.transformaction;

import org.apache.flink.api.common.functions.Partitioner;

public class MyPartitionerJava implements Partitioner<Integer> {
    @Override
    public int partition(Integer integer, int i) {
        System.out.println("分区总数："+i);
        if( integer % 2 == 0 ){ //偶数分到0号分区
            return 0;
        }else { //奇数分到1号分区
            return 1;
        }

    }
}
